#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 
# Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
# 

"""
File: run16.py
Author: zhangyang(zhangyang40@baidu.com)
Date: 2018/1/5 0005 14:44
"""


class Solution:
    class Solution:
        def __init__(self):
            self.stack = []
            self.min_stack = []

        def push(self, node):
            # write code here
            self.stack.append(node)
            if not self.min_stack or node <= self.min_stack[-1]:
                self.min_stack.append(node)

        def pop(self):
            # write code here
            if self.stack[-1] == self.min_stack[-1]:
                self.min_stack.pop()
            self.stack.pop()

        def top(self):
            # write code here
            return self.stack[-1]

        def min(self):
            # write code here
            return self.min_stack[-1]
